package com.puboot.module.admin.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.puboot.common.util.Pagination;
import com.puboot.module.admin.mapper.BizTeacherMapper;
import com.puboot.module.admin.model.BizTeacher;
import com.puboot.module.admin.service.BizTeacherService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @author ltc
 * @version 1.0
 * @date 2020/9/27 18:58
 */
@Service
@AllArgsConstructor
public class BizTeacherServiceImpl extends ServiceImpl<BizTeacherMapper, BizTeacher> implements BizTeacherService {
    private final BizTeacherMapper bizTeacherMapper;
    @Override
    public List<BizTeacher> selectTeachers(BizTeacher bizTeacher) {
        return bizTeacherMapper.PageTeachers(null,bizTeacher);
    }

    @Override
    public IPage<BizTeacher> PageTeachers(BizTeacher bizTeacher, Integer pageNumber, Integer pageSize) {
        IPage<BizTeacher> page = new Pagination<>(pageNumber, pageSize);
        return page.setRecords(bizTeacherMapper.PageTeachers(page, bizTeacher));
    }

    @Override
    public int deleteBatch(Integer[] ids) {
        return bizTeacherMapper.deleteBatchIds(Arrays.asList(ids));
    }


}
